From: Georges Basile Stavracas Neto Date: Tue, 15 Oct 2019 19:32:21 +0000 (+0200) Subject: environment: Parse repeat-count and auto-reverse X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~781^2^2~507 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f2466caef33fe0ee2ae7797c8e004b9394ead832;p=gnome-shell.git environment: Parse repeat-count and auto-reverse Those are two useful ClutterTimeline properties and will be needed for wiggling the search entry when failing the password. Add support for passing repeat-count and auto-reverse to ClutterActor.ease and ClutterActor.ease_property. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/768 --- diff --git a/js/ui/environment.js b/js/ui/environment.js index bbd33c965..20b546844 100644 --- a/js/ui/environment.js +++ b/js/ui/environment.js @@ -105,6 +105,16 @@ function _easeActor(actor, params) { actor.set_easing_delay(params.delay); delete params.delay; + let repeatCount = 0; + if (params.repeatCount != undefined) + repeatCount = params.repeatCount; + delete params.repeatCount; + + let autoReverse = false; + if (params.autoReverse != undefined) + autoReverse = params.autoReverse; + delete params.autoReverse; + if (params.mode != undefined) actor.set_easing_mode(params.mode); delete params.mode; @@ -127,10 +137,12 @@ function _easeActor(actor, params) { else Meta.disable_unredirect_for_display(global.display); - if (transition) + if (transition) { + transition.set({ repeatCount, autoReverse }); transition.connect('stopped', (t, finished) => callback(finished)); - else + } else { callback(true); + } } function _easeActorProperty(actor, propName, target, params) { @@ -143,6 +155,16 @@ function _easeActorProperty(actor, propName, target, params) { params.duration = adjustAnimationTime(params.duration); let duration = Math.floor(params.duration || 0); + let repeatCount = 0; + if (params.repeatCount != undefined) + repeatCount = params.repeatCount; + delete params.repeatCount; + + let autoReverse = false; + if (params.autoReverse != undefined) + autoReverse = params.autoReverse; + delete params.autoReverse; + // Copy Clutter's behavior for implicit animations, see // should_skip_implicit_transition() if (actor instanceof Clutter.Actor && !actor.mapped) @@ -168,7 +190,9 @@ function _easeActorProperty(actor, propName, target, params) { let transition = new Clutter.PropertyTransition(Object.assign({ property_name: propName, interval: new Clutter.Interval({ value_type: pspec.value_type }), - remove_on_complete: true + remove_on_complete: true, + repeat_count: repeatCount, + auto_reverse: autoReverse, }, params)); actor.add_transition(propName, transition);